package com.lanhao.aot;

import java.util.Scanner;

public class Test {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		System.out.print("请输入第一个正整数m: ");
		int m = scanner.nextInt();
		System.out.print("请输入第二个正整数n: ");
		int n = scanner.nextInt();
		scanner.close();

		int result = gcd(m, n);
		System.out.println("最大公约数为：" + result);
		
	}

	public static int gcd(int m, int n) {
		while (n != 0) {
			int temp = m % n;
			m = n;
			n = temp;
		}
		return m;
	}
}
